<?php
/*
Template Name: Single Post
*/
?>
<?php get_header(); ?>

<div id="content" class="content-singular content-single">
	<div class="pad">
		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<?php while (have_posts()) : ?>
	<?php the_post(); ?>

<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>		
<div class="content">
	<?php the_content(); ?>
	<?php wp_link_pages(array('before' => '<p class="pages"><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>

<?php
	$desc = get_the_author_meta('description');
	if (!empty($desc)) {
?>
<div class="post-box post-box-about-author">
	<div class="title">
		<h2>About the Author</h2>
	</div>
	<div class="interior">
		<?php echo get_avatar(get_the_author_meta('email'),53) ?>
		<p><?php echo $desc; ?></p>
		<div class="clear"></div>
	</div>
</div>
<?php 
	}
?>
<div class="post-box post-box-sb">
	<div class="title">
		<h2>Spread The Love, Share Our Article</h2>
	</div>
	<?php
		remove_filter('excerpt_more','padd_theme_excerpt_index_more');
		add_filter('get_the_excerpt','padd_theme_excerpt_bookmark');
		add_filter('excerpt_more','padd_theme_excerpt_bookmark_more');
		$padd_sb_url = urlencode(get_permalink());
		$padd_sb_title = urlencode(get_the_title());
		$padd_sb_notes = urlencode(get_the_excerpt());
		$padd_img_path = get_theme_root_uri() . '/' . PADD_THEME_SLUG . '/images/icon-bm-32-%s.png';
	?>
	<div class="interior">
		<ul>
			<li class="icon-delicious-mini">
				<a href="http://delicious.com/post?url=<?php echo $padd_sb_url; ?>&amp;title=<?php echo $padd_sb_title; ?>&amp;notes=<?php echo $padd_sb_notes; ?>">
					<img alt="Delicious" src="<?php printf($padd_img_path, 'delicious'); ?>" />
				</a>
			</li>
			<li class="icon-digg-mini">
				<a href="http://digg.com/submit?phase=2&amp;url=<?php echo $padd_sb_url; ?>&amp;title=<?php echo $padd_sb_title; ?>&amp;bodytext=<?php echo $padd_sb_notes; ?>">
					<img alt="Digg" src="<?php printf($padd_img_path, 'digg'); ?>" />
				</a>
			</li>
			<li class="icon-newsvine-mini">
				<a href="http://www.newsvine.com/_tools/seed&amp;save?u=<?php echo $padd_sb_url; ?>&amp;h=<?php echo $padd_sb_title; ?>">
					<img alt="NewsVine" src="<?php printf($padd_img_path, 'newsvine'); ?>" />
				</a>
			</li>
			<li class="icon-rss-mini">
				<a href="<?php bloginfo('rss2_url'); ?>">
					<img alt="RSS" src="<?php printf($padd_img_path, 'rss'); ?>" />
				</a>
			</li>
			<li class="icon-stumbleupon-mini">
				<a href="http://www.stumbleupon.com/post?url=<?php echo $padd_sb_url; ?>&amp;title=<?php echo $padd_sb_title; ?>">
					<img alt="StumbleUpon" src="<?php printf($padd_img_path, 'stumbleupon'); ?>" />
				</a>
			</li>
			<li class="icon-technorati-mini">
				<a href="http://technorati.com/faves?add=<?php echo $padd_sb_url; ?>">
					<img alt="Technorati" src="<?php printf($padd_img_path, 'technorati'); ?>" />
				</a>
			</li>
			<li class="icon-twitter-mini">
				<a href="http://twitter.com/home?status=<?php echo $padd_sb_title; ?>%20-%20<?php echo $padd_sb_url; ?>">
					<img alt="Twitter" src="<?php printf($padd_img_path, 'twitter'); ?>" />
				</a>
			</li>
		</ul>
	</div>
</div>
<?php 
	$enabled = get_option(PADD_THEME_SLUG . '_rp_enable');
	if ($enabled) { 
?>
<div class="post-box post-box-related">
	<div class="title">
		<h2>Related Posts</h2>
	</div>
	<div class="interior">
		<?php
			padd_related_posts(get_the_ID());
		?>
	</div>
</div>
<?php } ?>
<?php comments_template('',true); ?>
<?php endwhile; ?>

		</div>
	</div>
</div>

<?php get_sidebar(); ?>

<div class="clear"></div>

<?php get_footer(); ?>